pagesManager = {
	hideClass : "hide",
	currentPage : "content-index",
	lastPage : "content-index",
	lastController: HomeController,
	currentController : HomeController,
	
	setPage : function(page, isPopup, data) {
		if(isPopup) {
			$id("body").addClass("hideScroll");
		} else {
			$id(this.currentPage).addClass(this.hideClass);
		}
		this.showPage(page, isPopup, data);		
	},
	
	hidePage : function() {
		$id(this.currentPage).addClass(this.hideClass);
		$id("popup").addClass(this.hideClass);
		$id("body").removeClass("hideScroll");
		this.currentController = this.lastController;
		this.currentPage = this.lastPage;
	},
	
	showPage : function(page, isPopup, data) {	
		this.lastPage = this.currentPage;
		this.lastController = this.currentController;	
		this.currentPage = page.id;
		if(isPopup) {
			$id("popup").removeClass(this.hideClass);
		} 
		$id(this.currentPage).removeClass(this.hideClass);
		var ctrl = page.controller;
		if(ctrl) {
			this.currentController = ctrl;
			ctrl.init(data);
		}
	},
	
	showLoading: function() {
		$id("popup").removeClass(this.hideClass);
		$id("loadingView").removeClass(this.hideClass);	
	},
	
	hideLoading: function() {
		$id("popup").addClass(this.hideClass);
		$id("loadingView").addClass(this.hideClass);	
	}	
	
};